package com.jauker.badgeview.example.slice;

import com.jauker.badgeview.example.ResourceTable;
import ohos.aafwk.ability.fraction.FractionAbility;
import ohos.aafwk.content.Intent;
import ohos.agp.components.*;

public class TabActivity extends FractionAbility implements TabList.TabSelectedListener {

    private PageSlider mViewPager;

    @Override
    protected void onStart(Intent intent) {
        super.onStart(intent);
        super.setUIContent(ResourceTable.Layout_ability_main);
    }

    @Override
    public void onSelected(TabList.Tab tab) {
        mViewPager.setCurrentPage(tab.getPosition());
    }

    @Override
    public void onUnselected(TabList.Tab tab) {

    }

    @Override
    public void onReselected(TabList.Tab tab) {

    }

    public abstract class SectionsPagerAdapter extends PageSliderProvider {

        public SectionsPagerAdapter(){

        }

        @Override
        public int getCount() {
            return 2;
        }

        @Override
        public String getPageTitle(int position) {
            switch (position) {
                case 0:
                    return "Views";
                case 1:
                    return "ListView";
            }
            return null;
        }

        @Override
        public Object createPageInContainer(ComponentContainer componentContainer, int i) {
          return null;
        }


        @Override
        public void destroyPageFromContainer(ComponentContainer componentContainer, int i, Object o) {

        }

        @Override
        public boolean isPageMatchToObject(Component component, Object o) {
            return false;
        }
    }
}

